package org.ucn.dmaa0914.temadesign.group2.testLayer;

import org.ucn.dmaa0914.temadesign.group2.modelLayer.Person;

import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

/**
 * The test class PersonTest.
 *
 * @author  (your name)
 * @version (a version number or a date)
 */
public class PersonTest
{
    private Person personToTest;
    
    /**
     * Default constructor for test class PersonTest
     */
    public PersonTest()
    {
    }

    /**
     * Sets up the test fixture.
     *
     * Called before every test case method.
     */
    @Before
    public void setUp()
    {
        personToTest = new Person("John", "Giggedy Street 21", 47587, "Washington DC", "+0-557845-555-454578", "giggedy@gmail.com");
        
    }

    @Test
    public void testPerson()
    {
        assertEquals("John", personToTest.getName());
        assertEquals("Giggedy Street 21", personToTest.getAddress());
        assertEquals(47587, personToTest.getZip());
        assertEquals("Washington DC", personToTest.getCity());
        assertEquals("+0-557845-555-454578", personToTest.getPhone());
        assertEquals("giggedy@gmail.com", personToTest.getEmail());
                
        personToTest.setName("Buller");
        personToTest.setAddress("Buller1");
        personToTest.setZip(98);
        personToTest.setCity("Buller2");
        personToTest.setPhone("Buller3");
        personToTest.setEmail("Buller4");
        
        assertEquals("Buller", personToTest.getName());
        assertEquals("Buller1", personToTest.getAddress());
        assertEquals(98, personToTest.getZip());
        assertEquals("Buller2", personToTest.getCity());
        assertEquals("Buller3", personToTest.getPhone());
        assertEquals("Buller4", personToTest.getEmail());
    }
    
    /**
     * Tears down the test fixture.
     *
     * Called after every test case method.
     */
    @After
    public void tearDown()
    {
    }

}

